package com.example.bagibuku;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;

public class SignInToTwitter extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    	MenuInflater inflater = getMenuInflater();
    	inflater.inflate(R.layout.menu, menu);
    	return true;
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item){
    	switch (item.getItemId())
    	{
    	case R.id.menu_bookmark:
    	Toast.makeText(SignInToTwitter.this,"bookmark is selected", Toast.LENGTH_SHORT).show();
    	return true;
    	
    	case R.id.menu_save:
        	Toast.makeText(SignInToTwitter.this,"save is selected", Toast.LENGTH_SHORT).show();
        	return true;
        	
    	case R.id.menu_search:
        	//Toast.makeText(SignInToTwitter.this,"search is selected", Toast.LENGTH_SHORT).show();
    		showFungsiSearch(); 
        	return true;
        	
    	case R.id.menu_share:
        	Toast.makeText(SignInToTwitter.this,"share is selected", Toast.LENGTH_SHORT).show();
        	return true;
        	
    	case R.id.menu_delete:
        	Toast.makeText(SignInToTwitter.this,"delete is selected", Toast.LENGTH_SHORT).show();
        	return true;
        	
    	case R.id.menu_preferences:
        	Toast.makeText(SignInToTwitter.this,"preferences is selected", Toast.LENGTH_SHORT).show();
        	return true;
        	
        	default:
        		return super.onOptionsItemSelected(item);
    	}
    }
    public void showFungsiSearch (){
    	SignInToTwitter.this.startActivity(new Intent(SignInToTwitter.this, FungsiSearch.class));
    	//Intent FungsiSearch = new Intent(this,FungsiSearch.class);
    	//startActivity(FungsiSearch);
    }
    
}
